Repository navigation
Conversation
alanshaw
force-pushed
the
ash/fix/list-buckets-integration-test
branch
from
September 10, 2026 15:49
7a65883 to
c165d96
Compare
What failed. Case 9 of UnsignedStreamingPayloadTrailer_invalid_chunk_size sends a 36 KB aws-chunked body that the gateway rejects about 8 KB in. The gateway answers and closes the socket while the client is still writing, the Linux kernel replies to the in-flight write with a reset, and Go's HTTP client reports the write error instead of the S3 error the gateway produced. The earlier SignedStreamingPayload_invalid_chunk_size failure on #2 is the same race. The fix. A port of the upstream body-drain middleware from versity PRs versity#2345 and versity#2378. After the handler chain decides a response, the middleware reads and discards whatever is left of the request body, capped at 256 KB with one-second idle and five-second total deadlines, so the client can finish writing and read the real error. It also marks the connection Connection: close whenever the body was not fully consumed, which stops leftover upload bytes being parsed as the next request on a keep-alive connection. That second point is a genuine correctness fix, so this is worth carrying regardless of the flake. What changed. Seven files, all under s3api. The middleware and its tests are new. Three middlewares now take the body through the tracking wrapper instead of the raw fasthttp stream, one context key is added, and the middleware is registered in server.go right after panic recovery. Upstream had moved context keys into an internal/httpctx package our tree lacks, so I put the new key in our existing s3api/utils/context-keys.go and took the drain files from the versity#2378 merge commit with the module path rewritten. The upstream authors are niksis02 (ca8d434, d383e1f) and Ben McClelland (c366966) if you want to credit them in the commit.
alanshaw
added this pull request to stack #14
September 14, 2026 12:22
alanshaw
removed this pull request from stack #14
October 9, 2026 09:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.